package com.sm.dao;

import com.github.pagehelper.Page;
import com.sm.model.SystemInformation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SystemInformationMapper {
    int deleteByPrimaryKey(Integer systemInformationId);

    int insert(SystemInformation record);

    //添加系统通知记录
    int insertSelective(SystemInformation record);

    SystemInformation selectByPrimaryKey(Integer systemInformationId);

    int updateByPrimaryKeySelective(SystemInformation record);

    int updateByPrimaryKey(SystemInformation record);

    //查询未读系统消息的个数
    int selectSysInfoCount(@Param("userId") Integer userId, @Param("type") Integer type, @Param("infoStatus") Integer infoStatus);

    /**
     * 分页查询我的消息列表
     * @param receiverId    我的ID
     * @param type          类型 -1 全部消息 1我的消息 2系统消息
     * @return
     */
    Page<SystemInformation> selectSysListByReceiver(@Param("receiverId") Integer receiverId, @Param("type") Integer type);

    void deleteByIds(@Param("ids") List<Integer> ids);
}
